package end.TEST;

import org.junit.Test;

import end.util.AESUtils;
import end.util.MD5Utils;

/**
 * 
 * JsonStringTest.java 2016-7-13
 * 
 * Copyright zhaocj Inc. All rights reserved. Love Me Like Love Justin Bieber
 */
public class JsonStringTest {

	@Test
	public void test1(){
		String str  ="[{'id':13,'name':'用户管理','subFunction':[{'id':14,'name':'删除用户','url':'','parentId':13},{'id':15,'name':'更改用户','url':'','parentId':13},{'id':16,'name':'查看用户','url':'','parentId':13},{'id':17,'name':'增加用户','url':'','parentId':13}]},{'id':18,'name':'上师管理','subFunction':[{'id':19,'name':'删除上师','url':'','parentId':18},{'id':20,'name':'更改上师','url':'','parentId':18},{'id':21,'name':'查看上师','url':'','parentId':18},{'id':22,'name':'增加上师','url':'','parentId':18}]}]";
		str = str.replaceAll("name", "text").replaceAll("subFunction", "children");	
		System.out.println(str);
	}
	@Test
	public void test2() throws Exception{
		String saltCode = MD5Utils.getRandomString(8);
		System.out.println(saltCode);
		System.out.println("数据库盐值   + "
				+ AESUtils.aesEncrypt(saltCode, AESUtils.SALTKEY));
		String codePassword = MD5Utils.GetSaltCode("elephant", saltCode);
		System.out.println(codePassword);
	}
}
